import { defineConfig } from 'drizzle-kit';

import * as dotenv from 'dotenv';
import * as path from 'path';

// Loads .env file manually
dotenv.config({
  path: path.resolve(__dirname, './src/config/env/.env.development'), // adjust path if needed
});

export default defineConfig({
  schema: './src/database/schema.ts',
  out: './src/database',
  dialect: 'mysql',
  dbCredentials: {
    url: `mysql://${process.env.DB_USER}:${process.env.DB_PASSWORD}@${process.env.DB_HOST}:${process.env.DB_PORT}/${process.env.DB_NAME}`,
  },
});
